/*
 * AddressTests.cpp
 *
 *  Created on: 31 ��� 2010
 *      Author: Sartios
 */

#include <string>
using namespace std;

#include "AddressTests.h"
#include "../../../Domain/TeacherAddresses/Address/Address.h"

#include <cppunit/TestAssert.h>

namespace Teacher {

void	AddressTests::setUp(){

	teacherAddress_ =new Address;
	symbols_=new string("!@#$%^&*\\\"\(\(\',.?/;:}]{[|+=_-~`");
}

void	AddressTests::tearDown(){
	delete teacherAddress_;
	teacherAddress_ = NULL;
}
/*----------------------------------------------------------------------------------------------------*/
/*void	AddressTests::setTown_CharactersAsTownName_ReturnTrue(){

	string *town = new string("serres");
	bool result = teacherAddress_->setTown(town);
	delete town;
	CPPUNIT_ASSERT_ASSERTION_FAIL_MESSAGE("Set town should succeed for a name with chars",CPPUNIT_ASSERT(true==result));
}*/

void	AddressTests::setTown_CharactersAsTownName_TownEqualToParameter(){

	string *town =  new string("serres");
	teacherAddress_->setTown(town);
	bool result = ((*town)==(*teacherAddress_->getTown()))?true:false;
	delete town;
	CPPUNIT_ASSERT_MESSAGE("Set town should set the town name as chars given name",true==result);
}

/*void	AddressTests::setTown_NumbersAsTownName_ReturnFalse(){

	string *town =  new string("10105");
	bool result	=	teacherAddress_->setTown(town);
	delete town;
	CPPUNIT_ASSERT_ASSERTION_FAIL_MESSAGE("Set town should fail if the given town is number",CPPUNIT_ASSERT(false==result));
}*/

void	AddressTests::setTown_NumbersAsTownName_TownEqualToNull(){
	string *town =  new string("10105");
	teacherAddress_->setTown(town);
	bool result = ((NULL)==(teacherAddress_->getTown()))?true:false;
	delete town;
	CPPUNIT_ASSERT_MESSAGE("Town must be NULL if the setting parameter is number",(true==result));
}

/*void	AddressTests::setTown_SymbolsAsTownName_ReturnFalse(){
	string *town =  new string("!@#$%^&*\\\"\(\(\',.?/;:}]{[|+=_-~`");
	bool result	=	teacherAddress_->setTown(town);
	delete town;
	CPPUNIT_ASSERT_ASSERTION_FAIL_MESSAGE("Set town should fail if the given town contain symbols",CPPUNIT_ASSERT(false==result));
}*/

void	AddressTests::setTown_SymbolsAsTownName_TownEqualToNull(){

	teacherAddress_->setTown(symbols_);
	bool result = ((NULL)==teacherAddress_->getTown())?true:false;
	CPPUNIT_ASSERT_MESSAGE("Town must be NULL if the setting parameter contains symbols",(true==result));
}

/*void	AddressTests::setTown_NumSymbCharAsTownName_ReturnFalse(){
	string *town =  new string("!@#941Serres");
	bool result	=	teacherAddress_->setTown(town);
	delete town;
	CPPUNIT_ASSERT_ASSERTION_FAIL_MESSAGE("Set town should fail if the given town contain symbols,numbers and chars",CPPUNIT_ASSERT(false==result));
}*/

void	AddressTests::setTown_NumSymbCharAsTownName_TownEqualToNull(){
	string *town =  new string("!@#941Serres");
	teacherAddress_->setTown(town);
	bool result = ((NULL)==(teacherAddress_->getTown()))?true:false;
	delete town;
	CPPUNIT_ASSERT_MESSAGE("Town must be NULL if the setting parameter contain symbols,numbers and chars",(true==result));
}


/*void	AddressTests::getTown_TownHasBeenSettingUpToNull_ReturnNull(){
	teacherAddress_->setTown(NULL);
	bool result = teacherAddress_->getStreet();
	CPPUNIT_ASSERT_ASSERTION_FAIL_MESSAGE("Get must return NULL if the town is NULL",CPPUNIT_ASSERT(true==result));
}*/

/*void	AddressTests::getTown_TownHasBeenSettingUpWithValidTownName_ReturnTownName(){
	string *town = new string("Serres");
	bool result = ((*town)==teacherAddress_->getTown())?true:false;
	delete town;
	CPPUNIT_ASSERT_ASSERTION_FAIL_MESSAGE("Get must return the setting valid parameter",CPPUNIT_ASSERT(true==result));
}*/
/*----------------------------------------------------------------------------------------------------*/
/*void	AddressTests::setStreet_CharactersAsStreetName_ReturnTrue(){
	string *street = new string("Merarxias");
	bool result = teacherAddress_->setTown(street);
	delete street;
	CPPUNIT_ASSERT_ASSERTION_FAIL_MESSAGE("Set street should succeed in a street contains characters",CPPUNIT_ASSERT(true==result));
}*/

void	AddressTests::setStreet_CharactersAsStreetName_StreetEqualToPamareter(){
	string	*street = new string("Merarxias");
	teacherAddress_->setStreet(street);
	bool	result = ((*street)==(*teacherAddress_->getStreet()))?true:false;
	delete street;
	CPPUNIT_ASSERT_MESSAGE("Set town should set the town name as the valid given name",(true==result));
}

/*void	AddressTests::setStreet_NumbersAsStreetName_ReturnFalse(){
	string *street = new string("123456");
	bool result = teacherAddress_->setTown(street);
	delete street;
	CPPUNIT_ASSERT_ASSERTION_FAIL_MESSAGE("Set street should fail in a street contains numbers",CPPUNIT_ASSERT(false==result));
}*/

void	AddressTests::setStreet_NumbersAsStreetName_StreetEqualToNull(){
	string	*street = new string("123456");
	teacherAddress_->setStreet(street);
	bool	result = ((NULL)==(teacherAddress_->getStreet()))?true:false;
	delete street;
	CPPUNIT_ASSERT_MESSAGE("Street should be NULL if the given street is number",(true==result));
}

/*void	AddressTests::setStreet_SymbolsAsStreetName_ReturnFalse(){
	string *street = new string("!@#$%^&*\\\"\(\(\',.?/;:}]{[|+=_-~`");
	bool result = teacherAddress_->setTown(street);
	delete street;
	CPPUNIT_ASSERT_ASSERTION_FAIL_MESSAGE("Set street should fail in a street contains symbols",CPPUNIT_ASSERT(false==result));
}*/

void	AddressTests::setStreet_SymbolsAsStreetName_StreetEqualToNull(){
	teacherAddress_->setStreet(symbols_);
	bool	result = ((NULL)==(teacherAddress_->getStreet()))?true:false;
	CPPUNIT_ASSERT_MESSAGE("Street should be NULL if the given contains symbols",(true==result));
}

/*
void	AddressTests::setStreet_NumSymbCharAsStreetName_ReturnFalse(){
	string *street = new string("!@#$123Merarxias");
	bool result = teacherAddress_->setTown(street);
	delete street;
	CPPUNIT_ASSERT_ASSERTION_FAIL_MESSAGE("Set street should fail if street contains symbols, numbers and chars",CPPUNIT_ASSERT(false==result));
}
*/

void	AddressTests::setStreet_NumSymbCharAsStreetName_StreetEqualToNull(){
	string	*street = new string("!@#$123Merarxias");
	teacherAddress_->setStreet(street);
	bool	result = ((NULL)==(teacherAddress_->getStreet()))?true:false;
	delete street;
	CPPUNIT_ASSERT_MESSAGE("Street should be NULL if the given contains symbols, numbers and chars",(true==result));
}

/*void	AddressTests::setStreet_NullAsStreetName_ReturnFalse(){
	bool result = teacherAddress_->setTown(NULL);
	CPPUNIT_ASSERT_ASSERTION_FAIL_MESSAGE("Set street should fail if street is NULL",CPPUNIT_ASSERT(false==result));
}*/

void	AddressTests::setStreet_NullAsStreetName_StreetEqualToNull(){
	teacherAddress_->setStreet(NULL);
	bool	result = ((NULL)==(teacherAddress_->getStreet()))?true:false;
	CPPUNIT_ASSERT_MESSAGE("Street should be NULL if the given is NULL",(true==result));
}
/*
void	AddressTests::getStreet_StreetHasBeenSettingUpToNull_ReturnNull(){
	teacherAddress_->setStreet(NULL);
	bool result = teacherAddress_->getStreet();
	CPPUNIT_ASSERT_ASSERTION_FAIL_MESSAGE("Get must return NULL if the street is NULL",CPPUNIT_ASSERT(true==result));
}*/
/*
void	AddressTests::getStreet_StreetHasBeenSettingUpWithValidStreetName_ReturnStreetName(){
	string *street = new string("Merarxias");
	bool result = teacherAddress_->getStreet().compare(street->c_str());
	delete street;
	CPPUNIT_ASSERT_ASSERTION_FAIL_MESSAGE("Get must return the setting valid parameter",CPPUNIT_ASSERT(true==result));
}*/
/*----------------------------------------------------------------------------------------------------*/

/*void	setNumber_CharactersAsStreetNumber_ReturnFlase();*/
void	AddressTests::setNumber_CharactersAsStreetNumber_StreetNumberEqualToNull(){
	string *streetNumber = new string("MustBeNumber");
	teacherAddress_->setNumber(streetNumber);
	bool result = ((NULL)==(teacherAddress_->getNumber()))?true:false;
	delete streetNumber;
	CPPUNIT_ASSERT_MESSAGE("Street number must be null if the given parameter contains chars",(true==result));
}

/*void	setNumber_NumbersAsStreetNumber_ReturnTrue();*/
void	AddressTests::setNumber_NumbersAsStreetNumber_StreetNumberEqualToParameter(){
	string *streetNumber = new string("1234");
	teacherAddress_->setNumber(streetNumber);
	bool result = ((*streetNumber)==(*teacherAddress_->getNumber()))?true:false;
	delete streetNumber;
	CPPUNIT_ASSERT_MESSAGE("Street number must be equal to parameter if is number",(true==result));
}

/*void	setNumber_SymbolsAsStreetNumber_ReturnFalse();*/
void	AddressTests::setNumber_SymbolsAsStreetNumber_StreetNumberEqualToNull(){
	teacherAddress_->setNumber(NULL);
	bool result = ((NULL)==(teacherAddress_->getNumber()))?true:false;
	CPPUNIT_ASSERT_MESSAGE("Street number must be null if the given parameter contains chars",(true==result));
}

/*void	setNumber_NumSymbCharAsStreetNumber_ReturnFalse()*/;
void	AddressTests::setNumber_NumSymbCharAsStreetNumber_StreetNumberEqualToNull(){
	string *streetNumber = new string("!@#$Street1");
	teacherAddress_->setNumber(streetNumber);
	bool result = ((NULL)==(teacherAddress_->getNumber()))?true:false;
	delete streetNumber;
	CPPUNIT_ASSERT_MESSAGE("Street number must be null if the given parameter contains symbols ,chars and numbers",(true==result));
}

/*void	setNumber_NullAsStreetNumber_ReturnFalse();*/
void	AddressTests::setNumber_NullAsStreetNumber_StreetNumberEqualToNull(){
	teacherAddress_->setNumber(NULL);
	bool result = ((NULL)==(teacherAddress_->getNumber()))?true:false;
	CPPUNIT_ASSERT_MESSAGE("Street number must be null if the given parameter contains chars",(true==result));
}

/*void	getNumber_StreetNumberHasBeenSettingUpToNull_ReturnNull();
void	getNumber_StreetNumberHasBeenSettingUpWithValidStreetNumber_ReturnStreetNumber();*/

/*----------------------------------------------------------------------------------------------------*/

/*void	setOwnersInsuranceNumber_CharactersAsOwnersInsuranceNumber_ReturnFalse();*/
void	AddressTests::setOwnersInsuranceNumber_CharactersAsOwnersInsuranceNumber_OwnersInsuranceNumberEqualToNull(){
	string *ownersInsuranceNumber = new string("MustBeNumber");
	teacherAddress_->setOwnersInsuranceNumber(ownersInsuranceNumber);
	bool result = ((NULL)==(teacherAddress_->getOwnersInsuranceNumber()))?true:false;
	delete ownersInsuranceNumber;
	CPPUNIT_ASSERT_MESSAGE("Owners insurance number must be null if contains chars",(true==result));
}

/*void	setOwnersInsuranceNumber_NumbersAsOwnersInsuranceNumber_ReturnTrue();*/
void	AddressTests::setOwnersInsuranceNumber_NumbersAsOwnersInsuranceNumber_OwnersInsuranceNumberEqualToParameter(){
	string *ownersInsuranceNumber = new string("12345");
	teacherAddress_->setOwnersInsuranceNumber(ownersInsuranceNumber);
	bool result = ((*ownersInsuranceNumber)==(*teacherAddress_->getOwnersInsuranceNumber()))?true:false;
	delete ownersInsuranceNumber;
	CPPUNIT_ASSERT_MESSAGE("Owners insurance number must be equal to parameter if it's number",(true==result));

}

/*void	setOwnersInsuranceNumber_SymbolsAsOwnersInsuranceNumber_ReturnFalse();*/
void	AddressTests::setOwnersInsuranceNumber_SymbolsAsOwnersInsuranceNumber_OwnersInsuranceNumberEqualToNull(){
	string *ownersInsuranceNumber = new string(*symbols_);
	teacherAddress_->setOwnersInsuranceNumber(ownersInsuranceNumber);
	bool result = ((NULL)==(teacherAddress_->getOwnersInsuranceNumber()))?true:false;
	delete ownersInsuranceNumber;
	CPPUNIT_ASSERT_MESSAGE("Owners insurance number must be NULL if contains symbolss",(true==result));

}

/*void	setOwnersInsuranceNumber_NumSymbCharAsOwnersInsuranceNumber_ReturnFalse();*/
void	AddressTests::setOwnersInsuranceNumber_NumSymbCharAsOwnersInsuranceNumber_OwnersInsuranceNumberEqualToNull(){
	string *ownersInsuranceNumber = new string((*symbols_)+"0123456789sadf");
	teacherAddress_->setOwnersInsuranceNumber(ownersInsuranceNumber);
	bool result = ((NULL)==(teacherAddress_->getOwnersInsuranceNumber()))?true:false;
	delete ownersInsuranceNumber;
	CPPUNIT_ASSERT_MESSAGE("Owners insurance number must be NULL if contains symbols, numbers and chars",(true==result));

}

/*void	setOwnersInsuranceNumber_NullAsOwnersInsuranceNumber_ReturnFalse();*/
void	AddressTests::setOwnersInsuranceNumber_NullAsOwnersInsuranceNumber_OwnersInsuranceNumberEqualToNull(){
	teacherAddress_->setOwnersInsuranceNumber(NULL);
	bool result = ((NULL)==(teacherAddress_->getOwnersInsuranceNumber()))?true:false;
	CPPUNIT_ASSERT_MESSAGE("Street number must be null if the given parameter contains chars",(true==result));
}

/*void	setOwnersInsuranceNumber_NumberLengthBiggerThan15AsOwnersInsuranceNumber_ReturnFalse();*/
void	AddressTests::setOwnersInsuranceNumber_NumberLengthBiggerThan15AsOwnersInsuranceNumber_OwnersInsuranceNumberEqualToNull(){
	string *ownersInsuranceNumber = new string("012345678910121314");
	teacherAddress_->setOwnersInsuranceNumber(ownersInsuranceNumber);
	bool result = ((NULL)==(teacherAddress_->getOwnersInsuranceNumber()))?true:false;
	delete ownersInsuranceNumber;
	CPPUNIT_ASSERT_MESSAGE("Owners insurance number must be null if the number's length is bigger than 15",(true==result));

}

/*void	setOwnersInsuranceNumber_NumberLengthSmallerThan4AndNumberLengthBiggerThan15AsOwnersInsuranceNumber_ReturnTrue();*/
void	AddressTests::setOwnersInsuranceNumber_NumberLengthSmallerThan4AndNumberLengthBiggerThan15AsOwnersInsuranceNumber_OwnersInsuranceNumberEqualToParameter(){
	string *ownersInsuranceNumber = new string("012");
	teacherAddress_->setOwnersInsuranceNumber(ownersInsuranceNumber);
	bool result = ((NULL)==(teacherAddress_->getOwnersInsuranceNumber()))?true:false;
	delete ownersInsuranceNumber;
	CPPUNIT_ASSERT_MESSAGE("Owners insurance number must be NULL if the number's length is smaller than 4",(true==result));

}

/*void	setOwnersInsuranceNumber_NumberLengthSmallerThan4AsOwnersInsuranceNumber_ReturnFalse();*/
void	AddressTests::setOwnersInsuranceNumber_NumberLengthSmallerThan4AsOwnersInsuranceNumber_OwnersInsuranceNumberEqualToNull(){
	string *ownersInsuranceNumber = new string("01234");
	teacherAddress_->setOwnersInsuranceNumber(ownersInsuranceNumber);
	bool result = ((*ownersInsuranceNumber)==(*teacherAddress_->getOwnersInsuranceNumber()))?true:false;
	delete ownersInsuranceNumber;
	CPPUNIT_ASSERT_MESSAGE("Owners insurance number must be equal to parameter if the number's length is <4 and >15",(true==result));
}

/*void	getOwnersInsuranceNumber_OwnersInsuranceNumberHasBeenSettingUpToNull_ReturnNull();
void	getOwnersInsuranceNumber_OwnersInsuranceNumberHasBeenSettingUpWithValidInsuranceNumber_ReturnSOwnersInsuranceNumber();*/

/*----------------------------------------------------------------------------------------------------*/
}
